package SeqList;

public class Sqmain {
    public static void main(String[] args) throws Exception {

        SqList L = new SqList(10);
        L.insert(0, "城市A");
        L.insert(1, "城市B");
        L.insert(2, "城市C");
        L.insert(3, "城市D");
        L.insert(4, "城市E");
        L.insert(5, "城市F");
        L.insert(6, "城市G");
        L.insert(7, "城市H");
        L.insert(8, "城市I");
        L.insert(9, "城市J");
        System.out.println("城市名称：");
        L.display();
        System.out.println();


        System.out.println("以平面的形式输出网图：");
        System.out.println("               "+L.get(9));
        System.out.println("                 ↑");
        System.out.println(L.get(0)+"-->"+L.get(3)+"-->"+L.get(6)+"-->"+L.get(7)+"-->"+L.get(1)+"-->"+L.get(2)+"-->"+L.get(4)+"-->"+L.get(5));
        System.out.println("                 ↓");
        System.out.println("               "+L.get(8));
        System.out.println();
        System.out.println(L.get(0)+"到"+L.get(3)+"之间的权值为：3");
        System.out.println(L.get(3)+"到"+L.get(6)+"之间的权值为：2");
        System.out.println(L.get(6)+"到"+L.get(9)+"之间的权值为：9");
        System.out.println(L.get(6)+"到"+L.get(8)+"之间的权值为：8");
        System.out.println(L.get(6)+"到"+L.get(7)+"之间的权值为：7");
        System.out.println(L.get(7)+"到"+L.get(1)+"之间的权值为：5");
        System.out.println(L.get(1)+"到"+L.get(2)+"之间的权值为：4");
        System.out.println(L.get(2)+"到"+L.get(4)+"之间的权值为：6");
        System.out.println(L.get(4)+"到"+L.get(5)+"之间的权值为：1");
        System.out.println();



    }
}